﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Error.ascx.cs" company="Anton Frattaroli">
//   Copyright (c) Anton Frattaroli. All rights reserved.
// </copyright>
// <summary>
//   Defines the Error class.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace LidocaineWeb.Modules
{
    using System;
    using System.Web.UI;
    
    /// <summary>
    /// Defines the Error class.
    /// </summary>
    public partial class Error : UserControl
    {
        /// <summary>
        /// This method is triggered on Page_Load.
        /// </summary>
        /// <param name="sender">The caller of the event.</param>
        /// <param name="e">The parameters of the event.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["Code"] == "401")
            {
                this.Message.Text = "You are unauthorized to access this area.";
            }
            else if (Request.QueryString["Code"] == "403")
            {
                this.Message.Text = "There is no default page for this directory.";
            }
            else if (Request.QueryString["Code"] == "404")
            {
                this.Message.Text = "This page does not exist.";
            }
            else
            {
                this.Message.Text = "There was an unhandled error.";
            }
        }
    }
}